prefix=/usr
DATADIR=$(prefix)/share
BINDIR=$(prefix)/bin
iconsizes := 16 24 32 36 48 96

help:
	$(info * type 'sudo make install' to install)
	@echo -n

install:
	mkdir -p $(DESTDIR)$(DATADIR)/compiz
	install -m 644 data/desktop-effects.glade $(DESTDIR)$(DATADIR)/compiz
	for iconsize in $(iconsizes);do mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/$$iconsize\x$$iconsize/apps/ && install data/desktop-effects$$iconsize.png $(DESTDIR)$(DATADIR)/icons/hicolor/$$iconsize\x$$iconsize/apps/desktop-effects.png;done
	mkdir -p $(DESTDIR)$(BINDIR) 
	install src/desktop-effects.py $(DESTDIR)$(BINDIR)/desktop-effects
	mkdir -p $(DESTDIR)$(DATADIR)/applications
	install -m 644 data/desktop-effects.desktop $(DESTDIR)$(DATADIR)/applications
	if which gtk-update-icon-cache 2>&1>/dev/null && test -f $(DESTDIR)$(prefix)/share/icons/hicolor/index.theme; then gtk-update-icon-cache -f $(DESTDIR)$(prefix)/share/icons/hicolor; fi

uninstall:
	-rm $(DESTDIR)$(DATADIR)/compiz/desktop-effects.glade
	-for iconsize in $(iconsizes);do rm $(DESTDIR)$(DATADIR)/icons/hicolor/$$iconsize\x$$iconsize/apps/desktop-effects$$iconsize.png;done
	-rm $(DESTDIR)$(BINDIR)/desktop-effects
	-rm $(DESTDIR)$(DATADIR)/applications/desktop-effects.desktop
	
